#include<stdio.h>
int main() 
{
	int number = 0;
	scanf_s("%x", &number);
	printf("%d",number);

	return 0;

}